<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\Traits\Filters;


class DealLog extends Model
{
    use Filters;

    protected $table = "deal_log";
    

    protected static function add_log($user_id,$to_user_id,$money,$status,$comment)
    {
        DealLog::insert([
            'user_id' =>$user_id,
            'to_user_id' =>$to_user_id,
            'money' =>$money,
            'status' =>$status,
            'comment' =>$comment,
            'created_at' =>date('Y-m-d H:i:s'),
            'updated_at' =>date('Y-m-d H:i:s'),
        ]);
    }

    public function user()
    {
        return $this->belongsTo(User::class,'user_id','id');
    }



}

